package com.ita.os.merchant.service.impl;

import org.junit.Test;

import com.ita.os.merchant.exception.UserExistException;
import com.ita.os.merchant.po.Merchant;

public class MerchantServiceImplTest {
	
	private MerchantServiceImpl merchantServiceImpl = new MerchantServiceImpl();
	@Test
	public void testFindMerchant() {
		 Merchant merchant = new Merchant();
		 merchant = merchantServiceImpl.findMerchant("Tmac", "password");
		 System.out.println(merchant.toString());
	}

	@Test
	public void testAddMerchant() throws UserExistException {
		Merchant merchant = new Merchant();
		merchant.setMname("Tmac");
		merchant.setPassword("password");
		System.out.println(merchantServiceImpl.addMerchant(merchant));
	}

	@Test
	public void testUpdateMerchant() {
		Merchant merchant = new Merchant();
		merchant.setMid(1);
		merchant.setMname("Tom");
		merchant.setPassword("password");
		System.out.println(merchantServiceImpl.updateMerchant(merchant));
	}
}
